<div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
    <div class="layui-tab" style="margin-left: 20px;">
        <ul class="layui-tab-title">
            <li class="layui-this">节点信息</li>
            <li>节点属性</li>
            <li>节点人员</li>
            <li>节点转出</li>
<!--            <li>节点事务</li>-->
        </ul>
        <input type="hidden" name="flow_id" value="{$one.flow_id}"/>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <div class="layui-form-item">
                    <label class="layui-form-label">节点ID</label>
                    <div class="layui-input-block">
                        <input type="text" required="required" value="{$one.id ?? ''}"  readonly  placeholder="请输入节点ID" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">步骤名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="process_name" required="required"  value="{$one.process_name ?? ''}" placeholder="请输入步骤名称" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">步骤尺寸</label>
                    <div class="layui-input-block">
                        <div class="layui-input-inline">
                            <input type="text" name="style_width" value="{$one.style.width ?? ''}" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid">X</div>
                        <div class="layui-input-inline">
                            <input type="text" name="style_height" autocomplete="off" class="layui-input" value="{$one.style.height ?? ''}" readonly >
                        </div>

                    </div>
                </div>
            </div>
            <div class="layui-tab-item">

                <div class="layui-form-item">
                    <label class="layui-form-label">步骤类型</label>
                    <div class="layui-input-block">
                        <input type="radio" name="process_type" value="is_step" title="正常步骤" {if condition="$one.process_type eq 'is_step'"}checked="checked"{/if}>
                        <input type="radio" name="process_type" value="is_one" title="第一步" {if condition="$one.process_type eq 'is_one'"}checked="checked"{/if}>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">调用方法</label>
                    <div class="layui-input-block">
                        <input type="text" name="wf_action" required="required"  value="{$one.wf_action ?? 'view'}" placeholder="请输入调用方法" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">调用方法</label>
                    <div class="layui-input-inline">
                        <select name="is_sing" lay-verify="required" lay-search="">
                            <option value="">直接选择或搜索选择</option>
                            <option value="1" {if condition="$one.is_sing eq 1"}selected="selected"{/if}>允许会签</option>
                            <option value="2" {if condition="$one.is_sing eq 2"}selected="selected"{/if}>禁止会签</option>

                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">回退方式</label>
                    <div class="layui-input-inline">
                        <select name="is_back" lay-verify="required" lay-search="">
                            <option value="">直接选择或搜索选择</option>
                            <option value="1" {if condition="$one.is_back eq 1"}selected="selected"{/if}>不允许</option>
                            <option value="2" {if condition="$one.is_back eq 2"}selected="selected"{/if}>允许回退</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-tab-item">
                <div class="layui-form-item">
                    <label class="layui-form-label">办理人员</label>
                    <div class="layui-input-block">
                        <select name="auto_person"  id="auto_person_id" lay-filter="auto_person" datatype="*"  lay-verify="required" lay-search="">
                            <option value="">直接选择或搜索选择</option>
                            <option value="4" title="renyuan" {if condition="$one['auto_person'] eq 4"}selected="selected"{/if}>指定人员</option>
                            <option value="5" title="juese" {if condition="$one['auto_person'] eq 5"}selected="selected"{/if}>指定角色</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">选择人员</label>
                    <div class="layui-input-block">
                        <div id="demo1" class="xm-select-demo"></div>
                    </div>
                </div>
            </div>
            <div class="layui-tab-item">
                <div class="layui-form-item">
                    <label class="layui-form-label">步骤模式</label>
                    <div class="layui-input-block">
                        <select name="wf_mode" id="wf_mode_id" datatype="*" nullmsg="请选择步骤模式">
                            <option value="">请选择步骤模式</option>
                            {if condition='count($one.process_to)>1'}
                            <option value="1" {if condition="$one['wf_mode'] eq 1"}selected="selected"{/if}>转出模式（符合执行）</option>
                            <option value="2" {if condition="$one['wf_mode'] eq 2"}selected="selected"{/if}>同步模式（均需办理）</option>
                            {else/}
                            <option value="0" {if condition="$one['wf_mode'] eq 0"}selected="selected"{/if}>单线模式（流程为直线型单一办理模式）</option>
                            {/if}
                        </select>
                    </div>
                </div>
            </div>
<!--            <div class="layui-tab-item">内容5</div>-->
            <input type="hidden" name="process_condition" id="process_condition" value="{$one.process_tos ?? ''}">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-user-back-submit" id="LAY-user-back-submit" value="确认">
    </div>
</div>
<script src="/static/admin/layui/layui.js"></script>
<script src="/static/admin/js/xm-select.js"></script>
<script>
    layui.config({
        base: '/static/admin/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
    }).use(['index', 'form','element'], function () {
        var $ = layui.$, form = layui.form ,element = layui.element;
        form.render();
        var title =$('#auto_person_id').find("option:selected").attr("title");
        initialization(title);
        //监听select
        form.on('select(auto_person)',function (data) {
            var title = data.elem[data.elem.selectedIndex].title; //获取自定义属性
            var id = data.value;
            initialization(title);
        });
        //初始化方法
        function initialization(title) {
            $.ajax({
                url: "{:url('flow/nodePersonnel')}",
                data:{'title':title},
                type: 'post',
                dataType: 'json',
                success: function (res) {
                    xmSelect.render({
                        el: '#demo1',
                        filterable: true,
                        data: res
                    })
                }
            });
        }

    })
</script>

